<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>


<link href="style.css" rel="stylesheet" type="text/css" >

	<body class="body" >
	<logic:present name="auth" scope="session">
	
		<html:form action="/adminRouts" method="POST">
					<table border='1' class="adminrouts">
						<tr align="center" style="font-weight: bold; ">
							<td width="50" ><bean:message key="label.id" /></td>
							<td width="150" ><bean:message key="label.routs" /></td>
							<td width="150" ><bean:message key="label.date_routs" /></td>
							
						</tr>
						<c:forEach var="rout" items="${routs}">
						<tr>
							<td>		
								<html:checkbox property="id_check_routs" value="${rout.id_routs}">
									${rout.id_routs}
								</html:checkbox>
							</td>
							<td><b>
								${rout.name_routs}
								</b>
								<br>
								<c:forEach var="routsstantion" items="${routsstantion}">
									<c:if test="${rout.id_routs == routsstantion.id_stantion_routs}">
										<html:checkbox property="id_check_city" value="${routsstantion.id}">
											${routsstantion.name_city}	
										</html:checkbox>
										
										<br>
									</c:if>
								</c:forEach>
								
							</td>
							<td>
								- ${rout.date_routs} 
							</td>							
						</tr>
						</c:forEach>
						
						
					</table>
						
						<html:text property="add_name"></html:text>
						<html:errors property="add_name" />
						
						<html:select property="add_date">
							<html:option  value=""></html:option>
							<html:option value="every"></html:option>
							<html:option value="odd"></html:option>
							<html:option value="even"></html:option>
						</html:select>
						<html:errors property="add_date" />
						
						<html:submit property="add_routs" onclick="return confirm('Add?')? true : false;"><bean:message key="button.add_routs" /></html:submit>
						<br>
						
						<html:submit property="Show"><bean:message key="button.show" /></html:submit>
						<html:submit property="Updat" onclick="return confirm('Update?')? true : false;"><bean:message key="button.updata" /></html:submit>
						<html:submit property="Delete" onclick="return confirm('Delete?')? true : false;"><bean:message key="button.delete" /></html:submit>
						
				</html:form>
				<html:form action="/adminRouts" method="POST">
					<table border='1' class="adminrouts">
						<c:forEach var="routsUp" items="${routsUp}">
							<tr>		
								<td >
									${routsUp.id_routs}
								</td>
								<td>
									<html:text property="name_routs" value="${routsUp.name_routs}"/>
								</td>
								<td>
									<html:text property="date_routs" value="${routsUp.date_routs}"/>
								</td>								
							</tr>
						</c:forEach>						
					</table>
						<html:submit property="UpdateRouts" onclick="return confirm('Update?')? true : false;"><bean:message key="button.updata" /></html:submit>
				</html:form>
		</logic:present>
	</body>